{% extends "admin/base.html" %}

{% block content %}
<div class="jumbotron">
	<div class="container">
		<h1>数据统计</h1>
	</div>
</div>
<div class="container">
	<div class="row">
		<div class="col-md-4 text-right">
			<h5>共<b>{{ team_count }}</b> 个 {{ get_config('user_mode') }} 注册</h5>
			<h5>共<b>{{ ip_count }}</b> 个IP 地址</h5>
			<hr>
			<h5>共 <b>{{ challenge_count }}</b> 个挑战</h5>
			{% if most_solved %}
				<h5><b>{{ most_solved }}</b> 解决题目数量最多 <br>{{ solve_data[most_solved] }} 解决</h5>
			{% endif %}
			{% if least_solved %}
			<h5><b>{{ least_solved }}</b> 解决题目数量最少 <br>{{ solve_data[least_solved] }} 解决</h5>
			{% endif %}
		</div>

		<div class="col-md-8">
			<div id="solves-graph">
				<div class="text-center">
					<i class="fas fa-circle-notch fa-spin fa-3x fa-fw spinner"></i>
				</div>
			</div>
		</div>
	</div>

	<hr>

	<div class="row">
		<div class="col-md-12">
			<div id="solve-percentages-graph">
				<div class="text-center">
					<i class="fas fa-circle-notch fa-spin fa-3x fa-fw spinner"></i>
				</div>
			</div>
		</div>
	</div>

	<hr>

	<div class="row">
		<div class="col-md-6">
			<div id="keys-pie-graph">
				<div class="text-center">
					<i class="fas fa-circle-notch fa-spin fa-3x fa-fw spinner"></i>
				</div>
			</div>
			<div class="text-center">
				<h5><b>{{ solve_count }}</b> 个正确提交</h5>
				<h5><b>{{ wrong_count }}</b> 个错误提交</h5>
			</div>
		</div>
		<div class="col-md-6">
			<div id="categories-pie-graph">
				<div class="text-center">
					<i class="fas fa-circle-notch fa-spin fa-3x fa-fw spinner"></i>
				</div>
			</div>
		</div>
	</div>

</div>


{% endblock %}

{% block scripts %}
<script src="{{ url_for('views.themes', theme='core', path='js/vendor/plotly.min.js') }}"></script>
<script src="{{ url_for('views.themes', theme='admin', path='js/statistics/graphs.js') }}"></script>
{% endblock %}
